Skip to content

Query Service AIO #467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Aug 15, 2024
Merged

Query Service AIO #467

merged 12 commits into from
Aug 15, 2024

Conversation

vgvoleg
Copy link
Collaborator

@vgvoleg vgvoleg commented Aug 8, 2024

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Other information

Copy link

github-actions bot commented Aug 8, 2024

🌋 Here are results of SLO test for python-sync:

Grafana Dashboard

SLO-sync

@vgvoleg vgvoleg force-pushed the query_service_async branch 2 times, most recently from b72d422 to a5870d9 Compare August 12, 2024 15:36
@vgvoleg vgvoleg changed the title WIP: Query Service AIO Query Service AIO Aug 12, 2024
@vgvoleg vgvoleg requested a review from rekby August 12, 2024 16:52
@vgvoleg vgvoleg force-pushed the query_service_async branch from ff3ddcc to 8f654cb Compare August 12, 2024 16:59
async for result_set in results:
print(f"rows: {str(result_set.rows)}")

await pool.retry_operation_async(callee)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use execute_with_retries?

@vgvoleg vgvoleg force-pushed the query_service_async branch from 8f654cb to 52a6bfd Compare August 14, 2024 13:23
@@ -0,0 +1,143 @@
import asyncio
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to _v2_asyncio?

async for result_set in results:
print(f"rows: {str(result_set.rows)}")

await pool.retry_operation_async(callee)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

execute_with_retries?

self._state.reset()
self._state._change_state(QuerySessionStateEnum.CLOSED)
except Exception:
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to change state of the session on exception?
Do you need same behaviour for sync method?

self._tx_state._change_state(QueryTxStateEnum.ROLLBACKED)
return

await self._ensure_prev_stream_finished()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method override base method, but with other signature.
It is difference from sync class: sync class use method from base class.

What about do one of:

  1. Extract common part to base class and reuse it from both children
  2. Complete split method to sync and async - for same style.

Now I can fix bug in the base class and think about I fix the bug/change behaviour in both variants because it is base class. (Or forgot about async code at all).

Same for other methods from the base class.

@@ -58,7 +58,9 @@ async def _check_session_status_loop(self) -> None:
self._state.reset()
self._state._change_state(QuerySessionStateEnum.CLOSED)
except Exception:
pass
if not self._state._already_in(QuerySessionStateEnum.CLOSED):
self._state.reset()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Why do you need reset session state before set closed _state._state?
  2. When the session will be really closed (call DeleteSession and detach from attached stream?

@vgvoleg vgvoleg merged commit 7bfb416 into main Aug 15, 2024
11 checks passed
@vgvoleg vgvoleg deleted the query_service_async branch August 15, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants